define([
  'underscore',
  'backbone',
  'models/transcript'
], function(_, Backbone, Transcript) {

  var TranscriptCollection = Backbone.Collection.extend({
  	model: Transcript,
  	url: '/transcripts',
    ajaxParams: { 
      type: 'post', 
      contentType: 'application/json', 
      dataType: 'json' 
    },

  	parse: function(response) {
  		console.log(JSON.stringify(response.results));
  		return response.results;
  	},

    load: function(study, query) {
      // clear collection
      this.reset();
      // load
      var ajaxParams = _.extend({ 
          data: JSON.stringify({ study: study, query: query })
        }, this.ajaxParams);
      this.fetch(ajaxParams);
    }

  });

  return TranscriptCollection;
  
});